home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 1 (Walnut Creek)
/
Aminet - June 1993 [Walnut Creek].iso
/
aminet
/
text
/
tex
/
tpp410n.lha
/
TPPGlobal.lha
/
rexx
/
tpl
/
StartShowDVI.tpl
< prev
next >
Wrap
Text File
|
1992-05-02
|
2KB
|
69 lines
/* Start ShowDVI - Macro */
options results
binary='TeX:bin/ShowDVI'
hailstring = 'ShowDVI Optionen'
address 'TextPlus'
/* get name of current file */
'GetName'
showopts = result
/* strip off extension */
if RIGHT(showopts, 4) == '.tex' then do
len = LENGTH(showopts) - 4
showopts = LEFT(showopts, len)
end
'RequestString' hailstring'\\'showopts
showopts = result
n = WORDS(showopts)
fullname = WORD(showopts, n)
n = LENGTH(showopts) - LENGTH(fullname)
showopts = LEFT(showopts, n)
PARSE VALUE namestruc(fullname) WITH ivol idirs ibase .
IF fullname == "" then empty = 'true'
else empty = 'false'
IF "" == SUBSTR(fullname, 1+ivol+idirs+ibase) THEN DO
fullname = fullname||".dvi" /* supply a default extension */
ibase = ibase + 4
END
IF 0 = ivol THEN DO
direc = PRAGMA('d')
IF RIGHT(direc,1)~='/' & RIGHT(direc,1)~=':' THEN direc=direc||'/'
fullname = direc||fullname
DROP direc
END
ELSE DO
direc = SUBSTR(fullname, 1, ivol+idirs)
IF RIGHT(direc,1) = '/' THEN DO
n = LENGTH(direc)
direc = LEFT(direc, n-1)
END
call pragma 'Directory', direc
END
DROP ivol idirs ibase
/* valid filename/opts ? */
if empty = 'false' then do
/* showdvi already running? */
if show('P', 'showdvi') then do
address 'showdvi' 'tofront'
address 'showdvi' 'loadnew' fullname
address 'showdvi' 'activate'
end
else
address command binary showopts fullname
end
else
'Display' 'ShowDVI ... Abbruch'